package main

import (
	"fmt"
	// "io/ioutil"
	"net"
	"os"
)

func main() {
	fmt.Println("hello world")
	addr, err := net.ResolveTCPAddr("tcp4", "localhost:5050")
	fmt.Println(addr.IP, addr.Port)
	checkError(err)
	conn, err := net.DialTCP("tcp", nil, addr)
	checkError(err)
	defer conn.Close()
	recv := make([]byte, 4024)
	_, err = conn.Read(recv)
	checkError(err)
	fmt.Println(string(recv))
}

func checkError(err error) {
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
